home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / MPW IIGS Interfaces / CIIGSIncludes / ProDOS.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-03  |  9.9 KB  |  325 lines  |  [TEXT/MPS ]

  1. /********************************************
  2. ; File: ProDOS.h
  3. ;
  4. ;
  5. ; Copyright Apple Computer, Inc.1986-90
  6. ; All Rights Reserved
  7. ;
  8. ********************************************/
  9. #ifndef __TYPES__
  10. #include <TYPES.h>
  11. #endif
  12.  
  13. #ifndef __PRODOS__
  14. #define __PRODOS__
  15.  
  16. #ifdef __GSOS__ 
  17.  
  18. #undef GetSysPrefs       
  19. #undef BeginSession      
  20. #undef EndSession        
  21. #undef SessionStatus     
  22. #undef ResetCache        
  23. #undef ChangePath        
  24. #undef ClearBackupBit    
  25. #undef Close             
  26. #undef Create            
  27. #undef DControl          
  28. #undef Destroy           
  29. #undef DInfo             
  30. #undef DRead             
  31. #undef DStatus           
  32. #undef DWrite            
  33. #undef EraseDisk         
  34. #undef Flush             
  35. #undef Format            
  36. #undef GetBootVol        
  37. #undef GetDevNumber      
  38. #undef GetDirEntry       
  39. #undef GetEOF            
  40. #undef GetFileInfo       
  41. #undef GetFSTInfo        
  42. #undef GetLevel          
  43. #undef GetMark           
  44. #undef GetName           
  45. #undef GetPrefix         
  46. #undef GetVersion        
  47. #undef Newline           
  48. #undef Null              
  49. #undef Open              
  50. #undef Quit              
  51. #undef Read              
  52. #undef SetEOF            
  53. #undef SetFileInfo       
  54. #undef SetLevel          
  55. #undef SetMark           
  56. #undef SetPrefix         
  57. #undef UnbindInt         
  58. #undef Volume            
  59. #undef Write             
  60. #undef BindInt           
  61.  
  62. #undef ChangePathRec  
  63. #undef CreateRec  
  64. #undef DAccessRec  
  65. #undef DevNumRec  
  66. #undef DInfoRec  
  67. #undef DIORec  
  68. #undef DirEntryRec 
  69. #undef EOFRec 
  70. #undef FileInfoRec  
  71. #undef FormatRec  
  72. #undef FSTInfoRec  
  73. #undef InterruptRec  
  74. #undef IORec  
  75. #undef LevelRec  
  76. #undef NameRec
  77. #undef GetNameRec  
  78. #undef NewlineRec  
  79. #undef OpenRec  
  80. #undef PositionRec  
  81. #undef PrefixRec  
  82. #undef QuitRec  
  83. #undef RefNumRec  
  84. #undef SetPositionRec  
  85. #undef SysPrefRec  
  86. #undef VersionRec  
  87. #undef VolumeRec  
  88.  
  89. #endif 
  90.  
  91.  
  92.  
  93.  
  94. /* Error Codes */
  95. #define invalidCallNum 0x0001  /* invalid call number */
  96. #define unclaimedIntErr 0x01  /* fatal error - unclaimed interrupt */
  97. #define badPBlockPtr 0x05  /* call pointer out of bounds */
  98. #define pdosActiveErr 0x06  /* ProDOS is active */
  99. #define pdosBusyErr 0x07  /* ProDOS is busy */
  100. #define vcbUnusable 0x0A  /* fatal error - VCB unusable */
  101. #define fcbUnusable 0x0B  /* fatal error - FCB unusable */
  102. #define badBlockZero 0x0C  /* fatal error - block zero allocated illegally */
  103. #define shdwInterruptErr 0x0D  /* fatal error - interrupt occured while I/O shadowing off */
  104. #ifndef devNotFound  /* device not found */
  105. #define devNotFound 0x10
  106. #endif
  107. #define badDevRefNum 0x11  /* invalid device reference number */
  108. #define osVersionErr 0x11  /* Wrong OS version */
  109. #define badReqCode 0x20  /* invalid request code */
  110. #define intTableFull 0x25  /* interrupt table full */
  111. #define invalidOperation 0x26  /* invalid operation */
  112. #define ioError 0x27  /* I/O error */
  113. #define noDevConnect 0x28  /* no device connected */
  114. #define writeProtectErr 0x2B  /* write protect error */
  115. #define diskSwitchErr 0x2E  /* disk switched error */
  116. #define badPathname 0x40  /* invalid pathname syntax */
  117. #define fcbFullErr 0x42  /* FCB full error */
  118. #define badFileRefNum 0x43  /* invalid file reference number */
  119. #ifndef pathNotFound  /* path not found */
  120. #define pathNotFound 0x44
  121. #endif
  122. #define volumeNotFound 0x45  /* volume not found */
  123. #ifndef fileNotFound  /* file not found */
  124. #define fileNotFound 0x46
  125. #endif
  126. #define dupFileName 0x47  /* duplicate file name */
  127. #define volumeFullErr 0x48  /* volume full error */
  128. #define dirFullErr 0x49  /* directory full error */
  129. #define versionErr 0x4A  /* version error (incompatible file format) */
  130. #ifndef badStoreType  /* unsupported (or incorrect) storage type */
  131. #define badStoreType 0x4B
  132. #endif
  133. #ifndef eofEncountered  /* end-of-file encountered */
  134. #define eofEncountered 0x4C
  135. #endif
  136. #define positionRangeErr 0x4D  /* position out of range */
  137. #define accessErr 0x4E  /* access not allowed */
  138. #define fileOpenErr 0x50  /* file is open */
  139. #define dirDamaged 0x51  /* directory structure is damaged */
  140. #define badVolType 0x52  /* unsupported volume type */
  141. #ifndef paramRangeErr  /* parameter out of range */
  142. #define paramRangeErr 0x53
  143. #endif
  144. #define memoryFullErr 0x54  /* out of memory */
  145. #define vcbFullErr 0x55  /* VCB full error */
  146. #define dupVolumeErr 0x57  /* duplicate volume error */
  147. #define notBlkDevErr 0x58  /* not a blocked device */
  148. #ifndef invalidLevel  /* invalid level */
  149. #define invalidLevel 0x59
  150. #endif
  151. #define blkNumRangeErr 0x5A  /* block number out of range */
  152. #define notSameVolErr 0x5B  /* different volumes found on ChangePath call */
  153. #define notExecSysFile 0x5C  /* not an executable system file */
  154. #define osUnavailable 0x5D  /* Operating System/file system not available */
  155. #define deallocateRamErr 0x5E  /* Cannot deallocate /RAM */
  156. #ifndef stackOverflow  /* Return stack overflow */
  157. #define stackOverflow 0x5F
  158. #endif
  159. #define dataUnavailable 0x60  /* Data unavailable */
  160.  
  161. /* Other Constants */
  162. #define endofDirectory 0x0061
  163. #define P_READ_ENABLE 0x01
  164. #define P_WRITE_ENABLE 0x02
  165. #define P_DESTROY_ENABLE 0x80
  166. #define P_RENAME_ENABLE 0x40
  167. struct BlockRec {
  168.    Word blockDevNum; /*  */
  169.    Ptr blockDataBuffer; /*  */
  170.    Longint blockNum; /*  */
  171. } ;
  172. typedef struct BlockRec BlockRec, *BlockRecPtr;
  173. struct DevNumRec {
  174.    Ptr devName; /*  */
  175.    Word devNum; /*  */
  176. } ;
  177. typedef struct DevNumRec DevNumRec, *DevNumRecPtr;
  178. struct DInfoRec {
  179.    Word devNum; /*  */
  180.    Ptr devName; /*  */
  181. } ;
  182. typedef struct DInfoRec DInfoRec, *DInfoRecPtr;
  183. struct DirEntryRec {
  184.    Word refNum;
  185.    Word flags;
  186.    Word base;
  187.    Word displacement;
  188.    Pointer nameBuffer;
  189.    Word entryNum;
  190.    Word fileType;
  191.    Longint endOfFile;
  192.    LongWord blockCount;
  193.    TimeRec createTime;
  194.    TimeRec modTime;
  195.    Word access;
  196.    LongWord auxType;
  197.    Word fileSysID;
  198. } ;
  199. typedef struct DirEntryRec DirEntryRec, *DirEntryRecPtr;
  200. struct EOFRec {
  201.    Word eofRefNum; /*  */
  202.    Longint eofPosition; /*  */
  203. } ;
  204. typedef struct EOFRec EOFRec, *EOFRecPtr;
  205. struct FileIORec {
  206.    Word fileRefNum; /*  */
  207.    Ptr dataBuffer; /*  */
  208.    Longint requestCount; /*  */
  209.    Longint transferCount; /*  */
  210. } ;
  211. typedef struct FileIORec FileIORec, *FileIORecPtr;
  212. struct FileRec {
  213.    Ptr pathname; /*  */
  214.    Word fAccess; /*  */
  215.    Word fileType; /*  */
  216.    Longint auxType; /*  */
  217.    Word storageType; /*  */
  218.    Word createDate; /*  */
  219.    Word createTime; /*  */
  220.    Word modDate; /*  */
  221.    Word modTime; /*  */
  222.    Longint blocksUsed; /*  */
  223. } ;
  224. typedef struct FileRec FileRec, *FileRecPtr;
  225. struct FormatRec {
  226.    Ptr devName; /* device name pointer */
  227.    Ptr volName; /* device name pointer */
  228.    Word fileSysID; /* file system ID */
  229. } ;
  230. typedef struct FormatRec FormatRec, *FormatRecPtr;
  231. struct EraseDiskRec {
  232.    Ptr devName; /* device name pointer */
  233.    Ptr volName; /* device name pointer */
  234.    Word fileSysID; /* file system ID */
  235. } ;
  236. typedef struct EraseDiskRec EraseDiskRec, *EraseDiskRecPtr;
  237. struct InterruptRec {
  238.    Word intNum; /*  */
  239.    Ptr intCode; /*  */
  240. } ;
  241. typedef struct InterruptRec InterruptRec, *InterruptRecPtr;
  242. struct MarkRec {
  243.    Word markRefNum; /*  */
  244.    LongWord position; /*  */
  245. } ;
  246. typedef struct MarkRec MarkRec, *MarkRecPtr;
  247. struct NewLineRec {
  248.    Word newLRefNum; /*  */
  249.    Word enableMask; /*  */
  250.    Word newlineChar; /*  */
  251. } ;
  252. typedef struct NewLineRec NewLineRec, *NewLineRecPtr;
  253. struct OpenRec {
  254.    Word openRefNum; /*  */
  255.    Ptr openPathname; /*  */
  256.    Handle ioBuffer; /*  */
  257. } ;
  258. typedef struct OpenRec OpenRec, *OpenRecPtr;
  259. struct PathNameRec {
  260.    Ptr pathname; /*  */
  261.    Ptr newPathname; /*  */
  262. } ;
  263. typedef struct PathNameRec PathNameRec, *PathNameRecPtr;
  264. struct PrefixRec {
  265.    Word prefixNum; /*  */
  266.    Ptr prefix; /*  */
  267. } ;
  268. typedef struct PrefixRec PrefixRec, *PrefixRecPtr;
  269. struct QuitRec {
  270.    Ptr quitPathname; /*  */
  271.    Word flags; /*  */
  272. } ;
  273. typedef struct QuitRec QuitRec, *QuitRecPtr;
  274. struct VolumeRec {
  275.    Ptr deviceName; /*  */
  276.    Ptr volName; /*  */
  277.    LongWord totalBlocks; /*  */
  278.    LongWord freeBlocks; /*  */
  279.    Word fileSysID; /*  */
  280. } ;
  281. typedef struct VolumeRec VolumeRec, *VolumeRecPtr;
  282. #ifndef stackEntry
  283. #define stackEntry 0xE100B0
  284. #endif
  285. #ifndef sysCall
  286. extern pascal void sysCall() inline(0x0000,stackEntry); 
  287. #endif
  288.  
  289. #define ALLOC_INTERRUPT(pBlockPtr) sysCall(pBlockPtr,0x0031)
  290. #define CHANGE_PATH(pBlockPtr) sysCall(pBlockPtr,0x0004)
  291. #define CLEAR_BACKUP_BIT(pBlockPtr) sysCall(pBlockPtr,0x000B)
  292. #define CLOSE(pBlockPtr) sysCall(pBlockPtr,0x0014)
  293. #define CREATE(pBlockPtr) sysCall(pBlockPtr,0x0001)
  294. #define D_INFO(pBlockPtr) sysCall(pBlockPtr,0x002C)
  295. #define DEALLOC_INTERRUPT(pBlockPtr) sysCall(pBlockPtr,0x0032)
  296. #define DESTROY(pBlockPtr) sysCall(pBlockPtr,0x0002)
  297. #define ERASE_DISK(pBlockPtr) sysCall(pBlockPtr,0x0025)
  298. #define FLUSH(pBlockPtr) sysCall(pBlockPtr,0x0015)
  299. #define FORMAT(pBlockPtr) sysCall(pBlockPtr,0x0024)
  300. #define GET_BOOT_VOL(pBlockPtr) sysCall(pBlockPtr,0x0028)
  301. #define GET_DEV_NUM(pBlockPtr) sysCall(pBlockPtr,0x0020)
  302. #define GET_DIR_ENTRY(pBlockPtr) sysCall(pBlockPtr,0x001C)
  303. #define GET_EOF(pBlockPtr) sysCall(pBlockPtr,0x0019)
  304. #define GET_FILE_INFO(pBlockPtr) sysCall(pBlockPtr,0x0006)
  305. #define GET_LAST_DEV(pBlockPtr) sysCall(pBlockPtr,0x0021)
  306. #define GET_LEVEL(pBlockPtr) sysCall(pBlockPtr,0x001B)
  307. #define GET_MARK(pBlockPtr) sysCall(pBlockPtr,0x0017)
  308. #define GET_NAME(pBlockPtr) sysCall(pBlockPtr,0x0027)
  309. #define GET_PREFIX(pBlockPtr) sysCall(pBlockPtr,0x000A)
  310. #define GET_VERSION(pBlockPtr) sysCall(pBlockPtr,0x002A)
  311. #define NEWLINE(pBlockPtr) sysCall(pBlockPtr,0x0011)
  312. #define OPEN(pBlockPtr) sysCall(pBlockPtr,0x0010)
  313. #define QUIT(pBlockPtr) sysCall(pBlockPtr,0x0029)
  314. #define READ_BLOCK(pBlockPtr) sysCall(pBlockPtr,0x0022)
  315. #define READ(pBlockPtr) sysCall(pBlockPtr,0x0012)
  316. #define SET_EOF(pBlockPtr) sysCall(pBlockPtr,0x0018)
  317. #define SET_FILE_INFO(pBlockPtr) sysCall(pBlockPtr,0x0005)
  318. #define SET_LEVEL(pBlockPtr) sysCall(pBlockPtr,0x001A)
  319. #define SET_MARK(pBlockPtr) sysCall(pBlockPtr,0x0016)
  320. #define SET_PREFIX(pBlockPtr) sysCall(pBlockPtr,0x0009)
  321. #define VOLUME(pBlockPtr) sysCall(pBlockPtr,0x0008)
  322. #define WRITE_BLOCK(pBlockPtr) sysCall(pBlockPtr,0x0023)
  323. #define WRITE(pBlockPtr) sysCall(pBlockPtr,0x0013)
  324. #endif
  325.